home *** CD-ROM | disk | FTP | other *** search
/ WINMX Assorted Textfiles / Ebooks.tar / Text - Tech - OS - NT - security guide 06.txt < prev    next >
Text File  |  2003-09-27  |  7KB  |  125 lines

  1. NT security guideSection 06
  2. File and Directory Access
  3.  
  4. 06-1. How is file and directory security enforced?
  5. 06-2. What is NTFS?
  6. 06-3. Are there are vulnerabilities to NTFS and access controls?
  7. 06-4. What is Samba and why is it important?
  8. 06-5. I hack remotely. Once in, how can I do all that GUI stuff?
  9.  
  10.  
  11.  
  12. 06-1. How is file and directory security enforced?
  13. Since files and directories are considered objects (same as services), the 
  14. security is managed at an "object" level. 
  15. An access-control list (ACL) contains information that controls access to an 
  16. object or controls auditing of attempts to access an object. It begins with a 
  17. header contains information pertaining to the entire ACL, including the revision 
  18. level, the size of the ACL, and the number of access-control entries (ACEs) in 
  19. the list. 
  20. After the header is a list of ACEs. Each ACE specifies a trustee, a set of 
  21. access rights, and flags that dictate whether the access rights are allowed, 
  22. denied, or audited for the trustee. A trustee can be a user account, group 
  23. account, or a logon account for a service program. 
  24. A security descriptor can contain two types of ACLs: a discretionary ACL (DACL) 
  25. and a system ACL (SACL). 
  26. In a DACL, each ACE specifies the types of access that are allowed or denied for 
  27. a specified trustee. An object's owner controls the information in the object's 
  28. DACL. For example, the owner of a file can use a DACL to control which users can 
  29. have access to the file, and which users are denied access. 
  30. If the security descriptor for an object does not have a DACL, the object is not 
  31. protected and the system allows all attempts to access the object. However, if 
  32. an object has a DACL that contains no ACEs, the DACL does not grant any access 
  33. rights. In this case, the system denies all attempts to access the object. 
  34. In a SACL, each ACE specifies the types of access attempts by a specified 
  35. trustee that cause the system to generate audit records in the system event log. 
  36. A system administrator controls the information in the object's SACL. An ACE in 
  37. a SACL can generate audit records when an access attempt fails, when it 
  38. succeeds, or both. 
  39. To keep track of the individual object, a Security Identifier (SID) uniquely 
  40. identify a user or a group. 
  41. A SID contains: 
  42.   User and group security descriptors 
  43.   48-bit ID authority 
  44.   Revision level 
  45.   Variable subauthority values 
  46. A privilege is used to control access to a service or object more strictly than 
  47. is normal with discretionary access control. Privileges provide access to 
  48. services rarely needed by most users. For example, one type of privilege might 
  49. give access for backups and restorals, another might allow the system time to be 
  50. changed. 
  51.  
  52.  
  53.  
  54. 06-2. What is NTFS?
  55. NTFS is the Windows NT special file system. This file system is tightly 
  56. integrated into Windows security -- it is what allows access levels to be set 
  57. from the directory down to individual files within a directory. 
  58.  
  59.  
  60.  
  61. 06-3. Are there are vulnerabilities to NTFS and access controls?
  62. Not so much vulnerabilities as there are quirks -- quirks that can be exploited 
  63. to a certain degree. 
  64. For example, let's say the system admin has built a home directory for you on 
  65. the server, but has disallowed the construction of directories or files that you 
  66. wish to make available to the group Everyone. You are wanting to make this 
  67. special directory so that you can easily retrieve some hack tools but you are 
  68. cut off. However, if the sys admin left you as the owner of the home directory, 
  69. you can go in and alter its permissions. This is because as long as you are the 
  70. owner or Administrator you still control the file. Oh sure, you may get a few 
  71. complaints from the system when you are doing it, but it can be done. 
  72. Since NTFS has security integrated into it, there are not too many ways around 
  73. it. The main one requires access to the physical system. Boot up the system on a 
  74. DOS diskette, and use NTFSDOS.EXE. It will allow you to access an NTFS volume 
  75. bypassing security. 
  76. The last quirk is that if you have a directory with Full Control instead of 
  77. RWXDPO permissions, then you get a hidden permission called File Delete Child. 
  78. FDC cannot be removed. This means that all members of the group Everyone can 
  79. delete any read-only file in the directory. Depending on what the directory 
  80. contains, a hacker can replace a file with a trojan. 
  81.  
  82.  
  83.  
  84. 06-4. What is Samba and why is it important?
  85. Samba is a freeware app developed by Andy Tridgell. It is a great tool for 
  86. helping integrate Unix into Microsoft Windows and Lan Manager environments. The 
  87. main idea is that you can, with Samba, allow a Unix machine to access file and 
  88. directories. The other handy thing about Samba is that like most Unix freeware 
  89. you get the source code. 
  90. Most hackers seem to have Linux up and running, so loading up Samba allows you 
  91. several tactical advantages. A number of the exploits described here require 
  92. access to a privileged port (<1024). If you are root on your own Linux box, you 
  93. can start exploits from those needed ports. A lot of the tests in the NMRC lab 
  94. were conducted using Samba. In fact when World Star Holdings Ltd in Canada had 
  95. their lame Cybertest '96 contest on June 12th, yours truly used Samba to break 
  96. in (but I wasn't first). 
  97. Samba talks SMB and can directly access Windows NT hardware, and Hobbit 
  98. (hobbit@avian.org) has put together a very interesting paper entitled "CIFS: 
  99. Common Insecurities Fail Scrutiny". It is highly recommended reading for admins 
  100. and hackers alike. Included in the paper are details and source patches to allow 
  101. easier attacking on NT. 
  102. Studying the source code of Samba taught me a lot, but Hobbit's paper puts 
  103. everything in a whole new light. It provides some well documented basics on how 
  104. a lot of the communications work, detailing exactly WHY certain protocols and 
  105. behaviours are vulnerable to abuse. 
  106. Get Samba and read its documentation. Read Hobbit's paper and apply the patches. 
  107. Period. 
  108.  
  109.  
  110.  
  111. 06-5. I hack remotely. Once in, how can I do all that GUI stuff?
  112. The main problem is adjusting NT file security attributes. Some utilities are 
  113. available with NT that can be used, but I'd recommend using the NT Command Line 
  114. Security Utilities. They include: 
  115. saveacl.exe  - saves file, directory and ownership permissions to a file
  116. restacl.exe  - restores file permissions and ownership from a saveacl file
  117. listacl.exe  - lists file permissions in human readable format
  118. swapacl.exe  - swaps permissions from one user or group to another
  119. grant.exe    - grants permissions to users/groups on files
  120. revoke.exe   - revokes permissions to users/groups on files
  121. igrant.exe   - grants permisssions to users/groups on directories
  122. irevoke.exe  - revokes permissions to users/groups on directories
  123. setowner.exe - sets the ownership of files and directories
  124. nu.exe       - 'net use' replacement, shows the drives you're connected to
  125. The latest version can be found at ftp://ftp.netcom.com/pub/wo/woodardk/.